package com.ai.langchain4j.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalTime;

public class ScheduleTimeSlot {
    @TableId(type = IdType.AUTO)

    private Integer id;
    
    private String scheduleId; // 关联的排班主表
    
    private String slotStartTime; // 时段开始时间
    
    private String slotEndTime; // 时段结束时间
    
    private Integer totalQuota = 3; // 总号源，默认3个
    
    private Integer remainingQuota = 3; // 剩余号源，默认3个

    // 构造方法
    public ScheduleTimeSlot() {}

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getScheduleId() {
        return scheduleId;
    }

    public void setScheduleId(String scheduleId) {
        this.scheduleId = scheduleId;
    }

    public String getSlotStartTime() {
        return slotStartTime;
    }

    public void setSlotStartTime(String slotStartTime) {
        this.slotStartTime = slotStartTime;
    }

    public String getSlotEndTime() {
        return slotEndTime;
    }

    public void setSlotEndTime(String slotEndTime) {
        this.slotEndTime = slotEndTime;
    }

    public Integer getTotalQuota() {
        return totalQuota;
    }

    public void setTotalQuota(Integer totalQuota) {
        this.totalQuota = totalQuota;
    }

    public Integer getRemainingQuota() {
        return remainingQuota;
    }

    public void setRemainingQuota(Integer remainingQuota) {
        this.remainingQuota = remainingQuota;
    }

    public ScheduleTimeSlot(Integer id, String scheduleId, String slotStartTime, String slotEndTime, Integer totalQuota, Integer remainingQuota) {
        this.id = id;
        this.scheduleId = scheduleId;
        this.slotStartTime = slotStartTime;
        this.slotEndTime = slotEndTime;
        this.totalQuota = totalQuota;
        this.remainingQuota = remainingQuota;
    }

    // 退号操作：增加剩余号源
    public boolean cancelRegistration() {
        if (remainingQuota < totalQuota) {
            remainingQuota++;
            return true;
        }
        return false;
    }
}
